/*    */ package com.zimbra.cs.imap;
/*    */ 
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.security.sasl.Authenticator;
/*    */ import com.zimbra.cs.security.sasl.AuthenticatorUser;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ class ImapAuthenticatorUser
/*    */   implements AuthenticatorUser
/*    */ {
/*    */   private final ImapHandler mHandler;
/*    */   private final String mTag;
/* 30 */   private boolean canContinue = true;
/*    */   
/*    */   ImapAuthenticatorUser(ImapHandler handler, String tag) {
/* 33 */     this.mHandler = handler;
/* 34 */     this.mTag = tag;
/*    */   }
/*    */   
/* 37 */   String getTag() { return this.mTag; }
/*    */   
/* 39 */   boolean canContinue() { return this.canContinue; }
/*    */   
/* 41 */   public String getProtocol() { return "imap"; }
/*    */   
/*    */   public void sendBadRequest(String s) throws IOException {
/* 44 */     this.mHandler.sendBAD(this.mTag, s);
/*    */   }
/*    */   
/*    */   public void sendFailed() throws IOException {
/* 48 */     this.mHandler.sendNO(this.mTag, "AUTHENTICATE failed");
/*    */   }
/*    */   
/*    */   public void sendFailed(String msg) throws IOException {
/* 52 */     this.mHandler.sendNO(this.mTag, "AUTHENTICATE failed: " + msg);
/*    */   }
/*    */   
/*    */ 
/*    */   public void sendSuccessful()
/*    */     throws IOException
/*    */   {
/* 59 */     this.mHandler.sendOK(this.mTag, '[' + this.mHandler.getCapabilityString() + "] AUTHENTICATE completed");
/*    */   }
/*    */   
/*    */   public void sendContinuation(String s) throws IOException {
/* 63 */     this.mHandler.sendContinuation(s);
/*    */   }
/*    */   
/*    */   public boolean authenticate(String authorizationId, String authenticationId, String password, Authenticator auth) throws IOException
/*    */   {
/* 68 */     this.canContinue = this.mHandler.authenticate(authorizationId, authenticationId, password, this.mTag, auth);
/* 69 */     return this.mHandler.isAuthenticated();
/*    */   }
/*    */   
/*    */   public Log getLog() {
/* 73 */     return ZimbraLog.imap;
/*    */   }
/*    */   
/*    */   public boolean isSSLEnabled() {
/* 77 */     return this.mHandler.isSSLEnabled();
/*    */   }
/*    */   
/*    */   public boolean allowCleartextLogin() {
/* 81 */     return this.mHandler.getConfig().isCleartextLoginEnabled();
/*    */   }
/*    */   
/*    */   public boolean isGssapiAvailable() {
/* 85 */     return this.mHandler.getConfig().isSaslGssapiEnabled();
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/imap/ImapAuthenticatorUser.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */